﻿using B.MES.Customer.Domain;
using B.MES.Customer.Domain.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.MES.Customer.Infrastructure.IRepository
{
    /// <summary>
    /// RBAC仓储层
    /// </summary>
    public interface IRBACRepository:IBaseRepository<User>
    {
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="loginInput">包含用户名和密码的登录信息</param>
        /// <returns>根据用户名查询到的用户信息</returns>
        APIResult<OutPutLogin> UserLogin(InputLogin loginInput);
        /// <summary>
        /// MD5加密
        /// </summary>
        /// <param name="Password">需要加密的密码</param>
        /// <returns>加密之后的密码</returns>
        object GetMD5Pwd(string Password);

        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="requestUserDTO"></param>
        /// <returns></returns>
        APIResult<RequestUserDTO> AddUser(RequestUserDTO requestUserDTO);

        /// <summary>
        /// 获取所有角色
        /// </summary>
        /// <returns></returns>
        List<Role> GetRole();

        /// <summary>
        /// 单个删除（真删除）
        /// </summary>
        /// <param name="user_Id"></param>
        /// <returns></returns>
        APIResult<User> UserDeleteData(string user_Id);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        APIResult<List<User>> BatchDeleteData(List<User> list);

        /// <summary>
        /// 显示菜单
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        List<MemuDTO> GetMemus(string userId);

        /// <summary>
        /// 显示全部菜单
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        List<MemuDTO> GetMemus();

        /// <summary>
        /// 用户查询+分页+显示
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        PageApiResut<User> GetUserListByKeyword(string? user_Name, string? u_Name, int page, int size);

        /// <summary>
        /// 修改用户
        /// </summary>
        /// <param name="requestUserDTO"></param>
        /// <returns></returns>
        APIResult<RequestUserDTO> UpdateUser(RequestUserDTO requestUserDTO);

        /// <summary>
        /// 用户反填
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        APIResult<RequestUserDTO> GetUserSel(string userId);
    }
}
